﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Com.OpenCode.DwgConvert.Model
{
    /// <summary>
    /// 时间格式转换工具
    /// </summary>
    public static class DateTimeUtils
    {
        /// <summary>
        /// 获取当前时间的字符串
        /// </summary>
        /// <returns></returns>
        public static string GetCurrentDate()
        {
            return FromatDate(DateTime.Now);
        }

        /// <summary>
        /// 格式化时间
        /// </summary>
        /// <param name="dateTime"></param>
        /// <returns></returns>
        public static string FromatDate(DateTime dateTime)
        {
            return dateTime.ToString("yyyy-MM-dd HH:mm:ss");
        }

        /// <summary>
        /// 获取当前时间的字符串
        /// </summary>
        /// <returns></returns>
        public static string GetCurrentDateString()
        {
            return FromatDateString(DateTime.Now);
        }

        /// <summary>
        /// 格式化时间
        /// </summary>
        /// <param name="dateTime"></param>
        /// <returns></returns>
        public static string FromatDateString(DateTime dateTime)
        {
            return dateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒");
        }
    }
}
